package com.example.blueconn.data;

import androidx.annotation.NonNull;

import org.jetbrains.annotations.NotNull;

/**
 * Created by zhudongao
 * Desc
 * Date 3/25/21
 */

public class TempData implements Cloneable{
    public float temp1;
    public float temp2;
    public float temp3;
    public float temp4;
    public float temp5;

    public float getTempByIndex(int i) {
        switch (i) {
            case 0:
                return temp1;
            case 1:
                return temp2;
            case 2:
                return temp3;
            case 3:
                return temp4;
            case 4:
                return temp5;
            default:
                break;
        }
        return 0f;
    }

    @NotNull
    @Override
    public Object clone() throws CloneNotSupportedException {
        TempData data = null;
        try {
            data = (TempData) super.clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        return data;
    }

    @Override
    public String toString() {
        return "TempData{" +
                "temp1=" + temp1 +
                ", temp2=" + temp2 +
                ", temp3=" + temp3 +
                ", temp4=" + temp4 +
                ", temp5=" + temp5 +
                '}';
    }
}
